import Vue from 'vue'
import Router from 'vue-router'

const Login = (resolve) => { //登录页面
  import('page/login/login').then((Login) => {
    resolve(Login)
  })
}
const Auth = (resolve) => { //用户认证
  import('page/login/auth').then((Auth) => {
    resolve(Auth)
  })
}

const SpecialtyRelease = (resolve) => { //土特产发布页面
  import('page/localSpecialty/release').then((SpecialtyRelease) => {
    resolve(SpecialtyRelease)
  })
}
const SpecialtyList = (resolve) => { //土特产发布列表
  import('page/localSpecialty/list').then((SpecialtyList) => {
    resolve(SpecialtyList)
  })
}
const SpecialtyDetails = (resolve) => { //土特产详情页
  import('page/localSpecialty/details').then((SpecialtyDetails) => {
    resolve(SpecialtyDetails)
  })
}

Vue.use(Router)
export default new Router({
  mode: 'history',
  routes: [
    {path: '/', redirect: '/login'},
    {path: '/login', component: Login},//登录页面
    {path: '/auth', component: Auth},//认证页面
    {path: '/specialtyRelease', component: SpecialtyRelease},//土特产发布页面
    {path: '/specialtyList', component: SpecialtyList},//土特产发布列表
    {path: '/specialtyDetails', component: SpecialtyDetails},//土特产详情页
  ]
})
